#文件读入读出#####
install.packages("openxlsx")
library(openxlsx)
#设置文件路径
path="C:\\Users\\29228\\Desktop\\2024春学期各项汇报\\R语言与生物信息学"
setwd(path)
data1=read.table("ADdata1.txt")
data2=read.csv("ADdata2.csv")
data3=read.xlsx("ADdata3.xlsx")
data4=read.table("ADdata4.txt")
# 设置列名
rownames(data2)=data2[,1]
data2=data2[,-1]
dataframe12 <- merge(data1, data2, by.x = "row.names", by.y = "row.names", all = TRUE, no.dups = TRUE)
rownames(data3)=data3[,1]
data3=data3[,-1]
dataframe34=merge(data3,data4,by="row.names",no.dups = TRUE,all=TRUE)
dataframe1234=merge(dataframe12,dataframe34,no.dups = TRUE,all=TRUE)

write.csv(dataframe1234,file="C:\\Users\\29228\\Desktop\\2024春学期各项汇报\\R语言与生物信息学\\dataframe1234.csv")
write.table(dataframe1234,file="C:\\Users\\29228\\Desktop\\2024春学期各项汇报\\R语言与生物信息学\\dataframe1234.txt")
write.xlsx(dataframe1234,file="C:\\Users\\29228\\Desktop\\2024春学期各项汇报\\R语言与生物信息学\\dataframe1234.xls")
